<?php
/**
 * Created by PhpStorm.
 * User: Qinhir
 * Date: 2014/12/24
 * Time: 17:20
 */
//自定义日期函数,计算两个时间戳的差值
if (!function_exists('count_times_diff'))
{
    function count_times_diff($timestamp_one, $timestamp_two)
    {
        $diff = 0;
        $_tmp = $timestamp_one - $timestamp_two;
        if($_tmp < 0 ) return "{$diff}天";
        $days = floor($_tmp / 86400);
        $subTime = $_tmp % 86400;
        $hours = floor($subTime / 3600);
        $subTime = $subTime % 3600;
        $min = floor($subTime / 60);
        $sec = $subTime % 60;
        return "{$days}天{$hours}时{$min}分{$sec}秒";

    }
}